<%@ page import="mybatis.dao.StudentDao" %>
<%@ page import="mybatis.pojo.Student" %>
<%@ page import="mybatis.util.MybatisUtil" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2022/6/30
  Time: 13:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用jsp在网页中输出1900-2020之间的闰年</title>
</head>
<body>
<%
    for (int i = 1900; i <= 2020; i++) {
        if ((i % 4 == 0) && (i % 100 != 0) || (i % 400 == 0)) {
            out.print("闰年为：" + i + " ");
        }
    }
%>
<%
    SqlSession s = MybatisUtil.get();
    StudentDao mapper = s.getMapper(StudentDao.class);
    List<Student> list = mapper.findALL();
    list.forEach(System.out::println);
    MybatisUtil.close(s);
%>
</body>
</html>
